import request from '../utils/request.js'

// 发送验证码
export const getCode = data => request.get(`/sms/codes/${data.mobile}`)

// 登录
export const login = data => request.post('/authorizations',data)

// 获取用户频道列表
export const getUserChannels = () => request.get('/user/channels')

// 获取用户个人资料
export const getProfile = () => request.get('/user/profile')

// 编辑用户个人资料（包含实名认证）
export const editProfile = data => {
    return request({
      url: '/user/profile',
      data,
      method: 'PATCH'
    })
  }

// 编辑头像
export const editPhoto = data => {
  return request({
    url: '/user/photo',
    data:data.buffer,
    header: {
      'content-type': data.contentType
    },
    method: 'PATCH'
  })
}

